package com.cloud.system.api.mapper;

import com.cloud.system.api.entity.UnitPermit;
import com.cloud.system.common.utils.BaseMapperHelper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface UnitPermitMapper extends BaseMapperHelper<UnitPermit> {

    @Select("select * from unit_permit where permit_unit_id = #{unitId}")
    @Results({
            @Result(property = "permitId",column = "permit_id",javaType = Integer.class),
            @Result(property = "permitName",column = "permit_name",javaType = String.class),
            @Result(property = "permitPowerId", column = "permit_power_id", javaType = Integer.class),
            @Result(property = "permitPowerName", column = "permit_power_name", javaType = String.class),
            @Result(property = "permitUnitName", column = "permit_unit_name", javaType = String.class),
            @Result(property = "permitTypeName", column = "permit_type_name", javaType = String.class),
            @Result(property = "permitCode", column = "permit_code", javaType = String.class),
            @Result(property = "caseTypeId", column = "case_type_id", javaType = Integer.class),
            @Result(property = "caseTypeName", column = "case_type_name", javaType = String.class),
            @Result(property = "legalFinishTime", column = "legal_finish_time", javaType = Date.class),
            @Result(property = "promiseFinishTime", column = "promise_finish_time", javaType = Date.class),
            @Result(property = "serviceObjectTypeNames", column = "service_object_type_names", javaType = String.class),
            @Result(property = "handleMethodName", column = "handle_method_name", javaType = String.class),
            @Result(property = "lawItemContent", column = "law_item_content", javaType = String.class),
            @Result(property = "isCharge", column = "is_charge", javaType = String.class),
            @Result(property = "chargeStardard", column = "charge_stardard", javaType = String.class),
            @Result(property = "chargeLawItemContent", column = "charge_law_item_content", javaType = String.class),
            @Result(property = "applyDocs", column = "apply_docs", javaType = String.class),
    })
    List<UnitPermit> listPage(Long unitId);
}